import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import store from './store/index.js'
import components from './components/index.js'

export function createApp() {
  const app = createSSRApp(App)
  
  // 注册全局组件
  app.use(components)
  
  // 提供全局状态
  app.provide('$store', store)
  
  // 初始化状态（从本地存储恢复）
  store.actions.initializeState()
  
  return {
    app
  }
}
// #endif